home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / comm / irc / epic4-mos.lha / share / epic / script / newformat < prev    next >
Text File  |  2002-09-18  |  5KB  |  158 lines

  1. # $EPIC: newformat,v 1.2 2002/08/12 16:59:49 jnelson Exp $
  2. # This script is intended for use with 2.8 servers on all sites.
  3. # It's an extension of the 2.8script but with much much nicer 
  4. # formatting.
  5. # Written by Ian Frechette (daemon)
  6.  
  7. @ RCS.newformat = [$$Header: /home/cvs/repository/epic4/script/newformat,v 1.2 2002/08/12 16:59:49 jnelson Exp $$]
  8. # An operator command. ESC-t turns this option on and off.
  9. # It allows one to see users or not see them in a TRACE.
  10. # It also effects the output of STAT l
  11.  
  12. ^bind ^[t parse_command tt
  13. ^alias tt if (trace) { assign -trace } { assign trace x }
  14.  
  15. # Stores the output of a trace for use with conall
  16. ^alias trace ^cleantr;//trace $*
  17.  
  18. ^alias storetrace {
  19.     if (index([ $0)>-1) 
  20.       { assign trace.$strip([].-0123456789*/ $0) $left($index([ $0) $0) }
  21.       { assign trace.$strip([].-0123456789*/ $0) $0 }
  22. }
  23.  
  24. ^alias cleantr foreach trace ii { assign -trace[$ii] }
  25. # connect to all the servers listed in the last trace
  26. # food for when you restart the server.
  27. ^alias conall foreach trace ii { connect $trace[$ii] }
  28.  
  29. ^alias invite if ([$1]) { //invite $0 $1 } { //invite $0 $C }
  30.  
  31. # Don't EVER screw with the format() or lformat() commands
  32. # as many other things may use them.
  33. ^alias format {
  34.     @ IRCII.word = [$1-]
  35.     if (@IRCII.word < [$0]) 
  36.         { @ function_return = [$([-$0]IRCII.word)] } 
  37.         { @ function_return = [$IRCII.word] } 
  38. }
  39. ^alias lformat {
  40.     @ IRCII.word = [$1-]
  41.     if (@IRCII.word < [$0]) 
  42.         { @ function_return = [$([$0]IRCII.word)] } 
  43.         { @ function_return = [$IRCII.word] } 
  44. }
  45.  
  46.  
  47. # Trace information
  48. # -----------------
  49.  
  50. # define RPL_TRACELINK        200
  51. ^on ^200 * echo $[7]0 $1 $lformat(23 [$2]) ==> $3-
  52.  
  53. # define RPL_TRACECONNECTING  201
  54. ^on ^201 * echo $[7]0 $1 Class$format(7 [$2]) trying...  ==> $3-
  55.  
  56. # define RPL_TRACEHANDSHAKE   202
  57. ^on ^202 * echo $[7]0 $1 Class$format(7 [$2]) handshake  ==> $3-
  58.  
  59. # define RPL_TRACEUNKNOWN     203
  60. ^on ^203 * echo $[7]0 $1 Class$format(7 [$2]) *unknown*  ==> $3-
  61.  
  62. # define RPL_TRACEOPERATOR    204
  63. ^on ^204 * echo $[7]0 $1 Class$format(7 [$2])  $format(9 1C) ==> $left(35 $3)
  64.  
  65. # define RPL_TRACEUSER        205
  66. ^on ^205 * if (trace) { echo $[7]0 $1 Class$format(7 [$2])  $format(9 1C) ==> $left(35 $3) }
  67.  
  68. # define RPL_TRACESERVER      206
  69. ^on ^206 * storetrace $5;echo $[7]0 $1 Class$format(7 [$2]) $format(4 $3) $format(5 $4) ==> $left(35 $5)
  70.  
  71.  
  72. # define RPL_TRACESERVICE     207
  73. ^on ^207 * echo $[7]0 $1 Class[$format(7 $2)] service    ==> $3-
  74.  
  75. # define RPL_TRACENEWTYPE     208
  76. ^on ^208 * echo $[7]0 $1 Class[$format(7 $2)] newtype    ==> $3-
  77.  
  78. # define RPL_TRACECLASS       209
  79. ^on ^209 * echo $[7]0 -==- $1$format(7 [$2]) Entries linked: $3
  80.  
  81. # numeric 261   A debug file type in a trace
  82. ^on ^261 * echo $[7]0 $1 Level$format(7 [$3])  $[9]xbogus ==> $2
  83.  
  84.  
  85. # Stats information
  86. # -----------------
  87.  
  88. alias statsltime {
  89.     if ([$1] != [])
  90.         {@function_return = left(19 $*)}
  91.         {@function_return = left(16 $shorttime($tdiff($0)))}
  92. }
  93.  
  94. # takes time as returned from $tdiff() e.g. 23 days 1 hour 32 minutes 10 seconds
  95. #  and puts it in the format   23d 1h 32m 10s
  96. alias shorttime {
  97.     @ function_return = [$0] ## left(1 $1) ## [ $2] ## left(1 $3) ## [ $4] ## left(1 $5) ## [ $6] ## left(1 $7)
  98. }
  99.  
  100. alias stats {
  101.     if ([$0] == [l])
  102.     {
  103.         echo $lformat(17 Server) $lformat(40 Link) $lformat(16 Connect Time)
  104.         echo $lformat(10 SendQ) $lformat(10 SendM) $lformat(10 SendBytes) $lformat(10 RcveM) $lformat(7 RcveByte)
  105.     }
  106.     //stats $*
  107. }
  108.  
  109. # define RPL_STATSLINKINFO    211
  110. ^on ^211 * ^echo $[17]0 $[40]1 $statsltime($7-);echo $[10]2 $[10]3 $[10]4 $[10]5 $[7]6
  111. ^on ^211 "% *.*[*.*] *" ^echo $[17]0 $[40]1 $statsltime($7-);echo $[10]2 $[10]3 $[10]4 $[10]5 $[7]6
  112. ^on ^211 "% *[*" if (trace) {^echo $[17]0 $[40]1 $statsltime($7-);echo $[10]2 $[10]3 $[10]4 $[10]5 $[7]6}
  113. # ^on ^211 * ^echo $[7]0 $[20]1 $[10]3 $[10]5 $7-
  114.  
  115. # define RPL_STATSCOMMANDS    212
  116. ^on ^212 * ^echo $[7]0 $[10]1 :  $[-10]2 $[-10]3
  117.  
  118. # define RPL_STATSCLINE       213
  119. # ^on ^213 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  120.  
  121. # define RPL_STATSNLINE       214
  122. # ^on ^214 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  123.  
  124. # define RPL_STATSILINE       215
  125. ^on ^215 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  126.  
  127. # define RPL_STATSKLINE       216
  128. ^on ^216 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  129.  
  130. # define RPL_STATSQLINE      217
  131. ^on ^217 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  132.  
  133. # define RPL_STATSYLINE      218
  134. # ^on ^218 * ^echo $[7]0 $1:$[5]2:$[5]3:$[5]4:$[5]5:$6-
  135.  
  136. #
  137. # 220 is used by .troy versions to return information on
  138. # host masks being enforced locally.
  139. #
  140. ^on ^220 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  141.  
  142. # User Mode (2.1.5 actually knows about this. This is for 2.1.4e)
  143. # define RPL_UMODEIS          221
  144. ^on ^221 * ^echo  $[7]0 Your user mode is $1
  145.  
  146. ^comment Service list:
  147. ^on ^231 * ^echo  $[7]0 Service $1 ($0)
  148.  
  149. ^comment Ban list:
  150. ^on ^367 * ^echo $[7]0 ban in [ $[15]1 ] for [ $[30]2- ]
  151.  
  152. ^on ^369 * if (SHOW_END_OF_MSGS==[ON])
  153.     {
  154.         if (SHOW_NUMERICS==[ON]) {echo 369 $1-} {echo *** $1-}    
  155.     }
  156.  
  157. #Ian Frechette
  158.